import 'dart:convert';

import 'package:get/get.dart';
import 'package:study_demo/api/bean.dart';
import 'package:study_demo/base/BaseController.dart';

import '../../generated/assets.dart';
import '../../util/commond.dart';

class NoteDetailController extends BaseController {
  final commands = <CommandInfo>[].obs;

  @override
  Future<void> onInit() async {
    super.onInit();
    var content = await loadAsset(Assets.fileFlutterCommand);
    List<dynamic> list =
        json.decode(content).map((e) => CommandInfo.fromJson(e)).toList();
    commands.assignAll(List<CommandInfo>.from(list));
  }
}
